MDEV-40122: +DEFAULT is not a valid value for master_heartbeat_period - #5491
Open
prathamesh04 wants to merge 1 commit into
Open
MDEV-40122: +DEFAULT is not a valid value for master_heartbeat_period#5491prathamesh04 wants to merge 1 commit into
+DEFAULT is not a valid value for master_heartbeat_period#5491prathamesh04 wants to merge 1 commit into
Conversation
MDEV-28302 changed the grammar for master_heartbeat_period to accept DEFAULT (via num_or_default), while MDEV-38454 added an opt_plus to allow numeric values with an explicit `+` sign. The combination made the rule `opt_plus num_or_default`, which also accepted `+DEFAULT`, equivalent to `= DEFAULT`. Split the rule so that `opt_plus` may only precede a numeric literal, and DEFAULT is a separate alternative. Now `master_heartbeat_period= +DEFAULT` is a syntax error again, while `= +45` and `= DEFAULT` are both accepted.
Author
|
Hi @LinuxJedi, could you please take a look? This is a small parser fix for MDEV-40122, a mismerge of MDEV-38454 into MDEV-28302, with a regression test in |
ParadoxV5
self-requested a review
August 5, 2026 21:25
Contributor
|
I’m quite certain that LinuxJedi doesn’t work at MariaDB anymore. |
Member
|
This seems to be a clone of #4617 pushed to 10.11 some time ago. And it will hopefully be merged up the stack. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CHANGE MASTER TO master_heartbeat_period= +DEFAULT;was accepted as valid syntax (equivalent to= DEFAULT). It now produces a syntax error again.This is a mismerge of MDEV-38454 into MDEV-28302:
MASTER_HEARTBEAT_PERIOD_SYM '=' num_or_default, addingDEFAULTsupport.opt_plus(to allow values like+60) on top of it, resulting inopt_plus num_or_default, which also accepts+DEFAULT.Fix
Split the grammar rule in
sql/sql_yacc.yysoopt_plusmay only precede a numeric literal:MASTER_HEARTBEAT_PERIOD_SYM '=' opt_plus NUM_literal(numbers, with or without+)MASTER_HEARTBEAT_PERIOD_SYM '=' DEFAULTmaster_heartbeat_period= +45and= DEFAULTstill work;+DEFAULTis rejected withER_PARSE_ERROR.Note: 11.4 and 11.8 use
opt_plus NUM_literal(noDEFAULTat all), so they are not affected; the bug only exists on the 12.x line.Test
Extended
mysql-test/main/change_master_default.test(the MDEV-28302 test) with a regression case for+DEFAULTplus positive checks for+45andDEFAULT. Verified with:Both tests pass (the generated parser is rebuilt from
sql_yacc.yyat build time).Jira: https://jira.mariadb.org/browse/MDEV-40122
This contribution is licensed under the 3-clause BSD license.